<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml"
      xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <title>旧机入库</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--插件样式-->
    <link rel="stylesheet" href="/dist/plugins/select2/select2.min.css">
    <link href="/dist/plugins/ztree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/dist/plugins/webuploader-0.1.5/webuploader.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=f5a12a1d">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
    <style>
        td.td-value2 {
            padding: 1px !important;
            text-align: left !important;
        }

        .td-value2 input {
            box-shadow: inset 1px 1px 4px #333;
            height: 100% !important;
            padding-left: 4px !important;
        }

        .td-value2 select {
            box-shadow: inset 1px 1px 4px #333;
            height: 100% !important;
            padding-left: 4px !important;
        }

        .select {
            padding-left: 2px;
        }

        .IcoNormal {
            float: left;
            border-bottom: 0px;
            border-left: 0px;
            background-color: transparent;
            width: 16px;
            height: 16px;
            vertical-align: middle;
            border-top: 0px;
            border-right: 0px;
            background-image: url(/dist/img/upload_normal.gif);
            background-repeat: no-repeat;
            float: left;
        }

        td.td-title, td select, td .filename, td.td-module {
            color: #333;
        }

        td {
            position: relative;
        }

        .table .td-value span {
            line-height: 22px;
        }

        .delfile:hover {
            color: red;
        }

        .progressobj .delfile {
            float: left;
            margin-left: 10px;
        }

        .noFujian {
            /*background: url(/dist/img/fujian2.png) no-repeat 20px center;*/
            /*color: #ddd;*/
            cursor: no-drop;
            display: none;
        }

        table input {
            border: none;
            width: 100%;
        }

        td.td-value2, td span {
            color: #2a8cec;
        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }

        .lineOne {
            text-align: left;
        }

        .lineOne span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }

        input[type=text], input[type=tel], input[type=number], select {
            box-sizing: border-box;
            border-width: 0px;
            border-style: none;
            padding-right: 0px !important;
            padding-top: 0px !important;
            padding-bottom: 0px !important;
            margin-left: 0px !important;
            margin-right: 0px !important;
            margin-top: 0px !important;
            margin-bottom: 0px !important;
            padding-left: 6px;
        }

        input[type=text], input[type=tel], input[type=number], select {
            height: 24px;
            width: 100%;
            border: none;
            outline: none;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .lineOne {
            text-align: left;
        }

        .lineOne span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }

        .biTian {
            /*position: absolute;
            left: 30px;
            top: 6px;
            color: red;*/
            position: absolute;
            color: #000;
            margin-left: -15px;
            margin-top: 2px;
        }

        .webuploader-pick {
            background: url(/dist/img/fjT1.png) no-repeat 5px center;
            display: block;
            padding: 0 4px;
            height: 22px;
            line-height: 22px;
            padding-left: 15px;
            margin: 0 auto;
            width: 70px;
            margin-top: 6px;
            border-radius: 4px;
        }

        .webuploader-pick-hover {
            color: #fff !important;
            background: url(/dist/img/fjT2.png) no-repeat 5px center;
            background-color: #0F6099;

        }

        #divUploadedFiles {
            /*padding: 4px;*/
            padding-bottom: 0;
        }

        /*.webuploader-pick {*/
        /*position: relative;*/
        /*display: block;*/
        /*vertical-align: middle;*/
        /*cursor: pointer;*/
        /*background: url(/dist/img/fujianShu.png) no-repeat left center;*/
        /*background: #fff;*/
        /*box-shadow: 1px 1px 4px #333;*/
        /*color: #333;*/
        /*padding: 3px 6px;*/
        /*height: 100%;*/
        /*}*/

        #filePicker_csv div:nth-child(2) {
            width: 100% !important;
            height: 100% !important;
        }

        .title {
            background-color: yellow;
            color: black;
        }

        .jiaobiao3 {
            position: relative;
        }

        .jiaobiao3 i {
            display: block;
            width: 10px;
            height: 10px;
            background: url("/dist/img/newLog3.png");
            position: absolute;
            top: 0px;
            right: 0px;
        }

        .moreListData {
            position: absolute;
            top: 30px;
            z-index: 111;
            display: none;
        }

        .moreListData .item {
            width: 100%;
            height: 30px;
            line-height: 30px;
        }

        .moreListData .item span {
            margin-right: 5px;
        }

        .ui_main {
            vertical-align: top;
        }

        .table-detail textarea {
            height: 60px;
            width: 100%;
            border: none;
            outline: none;
            -webkit-appearance: none;
            resize: none;
            line-height: 20px;
            padding-top: 2px !important;
            padding-left: 6px;
        }
        .table-detail td{
            line-height: 24px;
        }

    </style>
</head>
<body>
<iframe id="ifAttach" style="display:none"></iframe>
<ul class="ztree" id="ulZTree"
    style="z-index:999;display:none;position:absolute;background-color:white;border:1px solid #72C3D9;height:200px;margin-top:0px;margin-left:0px;padding-left:0px;padding-top:5px;padding-bottom:5px;padding-right:0px;margin-right:0px;margin-bottom:0px;overflow: auto;"></ul>
<section class="content" id="app" v-cloak>
    <div class="div-td-content-more"><i></i></div>
    <div id="div" style="margin-top: 12px">
        <div style="float: left;width: 100%">
            <div class="center" style="overflow: auto;margin-left: -10px;margin-top:-20px"
                 id="scrollDiv">
                <div id="progress" class="wyui-progress"></div>
                <!--设备信息-->
                <table class="table table-detail table-bordered text-center" id="oldSample">
                    <!--公司人员信息-->
                    <tr class="no-print">
                        <td colspan="4" class=" no-print  title">公司人员信息</td>
                    </tr>
                    <template v-if="pageType!='look'">
                        <tr style="height:30px;">
                            <td style="color:black;background-color:#F8F8F8;width: 25%"><i class="biTian">*</i>归属公司</td>
                            <td style="width: 25%" class="td-value2">
                                <select class=" td-row2 td-value " id="testCom" v-model="displace.companyName"
                                        style=" padding-left: 2px;" @change="getCompanyId(displace.companyName,itemsCom)"
                                        v-if="showInput('0')">
                                    <option value=""></option>
                                    <option v-for="itemC in itemsCom" v-bind:value="itemC.name"> {{itemC.name}}</option>
                                </select>
                                <span v-else>{{displace.companyName}}</span>
                            </td>
                            <td style="color:black;background-color:#F8F8F8">区域经理</td>
                            <td class="td-value2 moreList" data-table="t_dvc_displace" data-column="regionManagerName"
                                data-type='1'>
                                <input class="td-value" placeholder="请输入区域经理名称" type="text" id="regionManagerName"
                                       v-model="displace.regionManagerName"  v-if="showInput('区域经理')"
                                       v-on:click.stop="inputFocus('regionManagerName')"/>
                                <span v-else>{{displace.regionManagerName}}</span>
                            </td>
                        </tr>
                        <tr style="height:30px">
                            <td style="color:black;background-color:#F8F8F8">大区经理</td>
                            <td class="td-value2 moreList" data-table="t_dvc_displace" data-column="bigregionManagerName"
                                data-type='1'>
                                <input class="td-value" type="text" v-model="displace.bigregionManagerName" v-if="">
                                <span v-else>{{displace.bigregionManagerName}}</span>
                            </td>
                            <td style="color:black;background-color:#F8F8F8;width: 25%">区域</td>
                            <td style="width: 25%;" class="td-value2 moreList" data-table="t_dvc_displace"
                                data-column="regionName" data-type='1'>
                                <input class="td-value" type="text" v-model="displace.regionName" v-if="">
                                <span v-else>{{displace.regionName}}</span>
                            </td>
                        </tr>
                    </template>
                   <!-- &lt;!&ndash;置换新机信息 &ndash;&gt;
                    <tr class="no-print">
                        <td colspan="4" class=" no-print  title">置换新机信息</td>
                    </tr>
                    <tr style="height:30px;">
                        <td style="color:black;background-color:#F8F8F8;width: 25%">客户</td>
                        <td class="td-value2">
                            <input type="text" v-if="showInput('置换客户')" v-model="displace.customerName">
                            <span v-else>{{displace.customerName}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8;width: 25%">品牌</td>
                        <td class="td-value2">
                            <input type="text" v-if="showInput('置换品牌')" v-model="displace.replacementDeviceBrandName">
                            <span v-else>{{displace.replacementDeviceBrandName}}</span>
                        </td>
                    </tr>
                    <tr style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">机型</td>
                        <td class="td-value2">
                            <input type="text" v-if="showInput('置换机型')" v-model="displace.replacementDeviceModelName">
                            <span v-else>{{displace.replacementDeviceModelName}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">序列号</td>
                        <td class="td-value2">
                            <input type="text" v-if="showInput('置换序列号')" v-model="displace.replacementDeviceSequence">
                            <span v-else>{{displace.replacementDeviceSequence}}</span>
                        </td>
                    </tr>-->
                    <!--旧机信息-->
                    <tr class="no-print">
                        <td colspan="4" class=" no-print title">旧机信息</td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px">
                        <td style="color:black;background-color:#F8F8F8"><i class="biTian">*</i>品牌</td>
                        <td class="td-value2">
                            <input type="text" v-model="displace.brandName" v-if="showInput('0')">
                            <span v-else>{{displace.brandName}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8"><i class="biTian">*</i>设备类型</td>
                        <td class="td-value2">
                            <select class=" td-row2 td-value" id="testType" v-model="displace.replacementType"
                                    style=" padding-left: 2px;"
                                    v-if="showInput('0')">
                                <option>挖掘机</option>
                                <option>装载机</option>
                                <option>压路机</option>
                                <option>起重机</option>
                                <option>推土机</option>
                                <option>平地机</option>
                                <option>摊铺机</option>
                                <option>搅拌运输车</option>
                                <option>破碎锤</option>
                            </select>
                            <span v-else>{{displace.replacementType}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px">
                        <td style="color:black;background-color:#F8F8F8"><i class="biTian">*</i>机型</td>
                        <td class="td-value2">
                            <input type="text" v-model="displace.modelName" v-if="showInput('0')">
                            <span v-else>{{displace.modelName}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">序列号</td>
                        <td class="td-value2">
                            <input type="text" v-model="displace.sequence" v-if="showInput('0')">
                            <span v-else>{{displace.sequence}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">出厂年份</td>
                        <td class="td-value2">
                            <input type="text" v-model="displace.factoryDate" v-if="showInput('0')"
                                   @focus="showDatePickerYear($event)">
                            <span v-else>{{displace.factoryDate}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">小时数(小时)</td>
                        <td class="td-value2">
                            <input type="text" v-model="displace.hours" v-if="showInput('0')">
                            <span v-else>{{displace.hours?displace.hours:"无"}}</span>
                            <!--<span v-if="displace.hours" style="position:absolute;left:170px;top: 3px;">小时</span>-->
                        </td>
                    </tr>
                    <tr style="height:30px">
                        <td style="color:black;background-color:#F8F8F8;height: 30px;">
                            <i class="biTian">*</i>状态
                        </td>
                        <td colspan="3" class="td-value2 moreList" data-table="t_dvc_displace" data-column="state"
                            data-type='1'>
                            <select class=" td-row2 td-value" v-model="displace.state"
                                    v-if="showInput('状态')"
                                    style=" padding-left: 2px;">
                                <option></option>
                                <option v-if="pageType=='edit'||displace.state=='提车在途'||displace.state=='库存'||displace.state==''" value="提车在途">
                                    提车在途
                                </option>
                                <option v-if="pageType=='edit'||displace.state=='提车在途'||displace.state=='交付在途'||displace.state=='移库在途'||displace.state=='退货在途'||displace.state=='库存'||displace.state==''"
                                value="库存">
                                    库存
                                </option>
                                <option v-if="isAdd!=1&&(displace.state=='交付在途'||displace.state=='已交')"
                                value="交付在途">交付在途</option>
                                <option v-if="isAdd!=1&&(displace.state=='交付在途'||displace.state=='已交')"
                                value="已交">已交</option>
                                <option v-if="isAdd!=1&&displace.state=='移库在途'"
                                value="移库在途">移库在途</option>
                                <option v-if="isAdd!=1&&(displace.state=='退货在途'||displace.state=='已退货')"
                                value="退货在途">退货在途</option>
                                <option v-if="isAdd!=1&&(displace.state=='已退货'||displace.state=='退货在途')"
                                value="已退货">已退货</option>
                            </select>
                            <span v-else>{{displace.state}}</span>
                        </td>
                    </tr>
                    <tr style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">库存地</td>
                        <td colspan="3" class="td-value2 moreList" data-table="t_dvc_displace"
                            data-column="storeAddress" data-type='1'>
                            <input type="text" id="storeAddress" v-model="displace.storeAddress" placeholder="例如：XX省XX市XXX" @blur="getAlert"
                                   v-if="showInput('库存地')">
                            <span v-else-if="pageType=='edit'&&displace.destination!=''&&displace.state=='库存'&&moveBound.main.type!=1">{{displace.destination}}</span>
                            <span v-else-if="pageType=='edit'&&displace.state=='库存'&&moveBound.main.type==1&&transportChange.destination==''">{{moveBound.main.delivery_address}}</span>
                            <span v-else-if="pageType=='edit'&&displace.state=='库存'&&transportChange.destination!=''">{{transportChange.destination}}</span>
                            <span v-else-if="pageType=='edit'&&displace.state!='库存'"></span>
                            <span v-else-if="pageType!='edit'">{{displace.storeAddress}}</span>
                        </td>
                    </tr>
                    <tr style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">原车客户姓名</td>
                        <td class="td-value2">
                            <input  v-model="displace.originalCustomerName" v-if="showInput('原车客户姓名')"/>
                            <span v-else>{{displace.originalCustomerName}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">原车客户电话</td>
                        <td class="td-value2">
                            <input  v-model="displace.originalCustomerTel" v-if="showInput('原车客户电话')"
                                    onkeyup="this.value=this.value.replace(/[^\w]/g,'')" />
                            <span v-else>{{displace.originalCustomerTel}}</span>
                        </td>
                    </tr>
                    <tr style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">设备来源</td>
                        <td class="td-value2">
                            <select v-model="displace.deviceSource"  v-if="" class=" td-row2 td-value" style=" padding-left: 2px;">
                                <option :value="item.value" v-for="(item,i) in deviceSources">{{item.value}}</option>
                            </select>
                            <span v-else>{{displace.deviceSource}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">设备状态</td>
                        <td class="td-value2">
                            <select v-model="displace.deviceStatus"  v-if="" class=" td-row2 td-value" style=" padding-left: 2px;">
                                <option :value="item.value" v-for="(item,i) in deviceStatuss">{{item.value}}</option>
                            </select>
                            <span v-else>{{displace.deviceStatus}}</span>
                        </td>
                    </tr>
                    <tr style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">评估价格(元)</td>
                        <td class="td-value2 moreList" data-table="t_dvc_displace" data-column="estimatePrice"
                            data-type='1'>
                            <input v-if="showInput('评估价格')" style="width: 100%;border: 0px" type="text"
                                   @blur="strFormat($event.target,'displace.estimatePrice')"
                                   @focus="strFormatF($event.target,'displace.estimatePrice')"
                                   v-onedate="fmoney(displace.estimatePrice)"
                            />
                            <span v-else class="pull-left"
                                  style="margin-left:0px">{{fmoney(displace.estimatePrice)}}</span>
                            <!--<span style="position:absolute;left:170px;top: 3px;">元</span>-->
                        </td>
                        <td style="color:black;background-color:#F8F8F8">置换价格(元)</td>
                        <td class="td-value2 moreList" data-table="t_dvc_displace" data-column="replacementPrice"
                            data-type='1'>
                            <input v-if="showInput('置换价格')" style="width: 100%;border: 0px" type="text"
                                   @blur="strFormat($event.target,'displace.replacementPrice')"
                                   @focus="strFormatF($event.target,'displace.replacementPrice')"
                                   v-onedate="fmoney(displace.replacementPrice)"
                            />
                            <span v-else class="pull-left"
                                  style="margin-left:0px">{{fmoney(displace.replacementPrice)}}</span>
                            <!-- <span style="position:absolute;left:170px;top: 3px;">元</span>-->
                        </td>
                    </tr>
                    <tr class="" style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">出售价格(元)</td>
                        <td class="td-value2 moreList" data-table="t_dvc_displace" data-column="sellPrice"
                            data-type='1'>
                            <input v-if="showInput('出售价格')" style="width: 100%;border: 0px" type="text"
                                   @blur="strFormat($event.target,'displace.sellPrice')"
                                   @focus="strFormatF($event.target,'displace.sellPrice')"
                                   v-onedate="fmoney(displace.sellPrice)"
                            />
                            <span v-else class="pull-left"
                                  style="margin-left:0px;">{{fmoney(displace.sellPrice)!=0?displace.sellPrice:"未出售"}}</span>
                            <!--<span style="position:absolute;left:170px;top: 3px;">元</span>-->
                        </td>
                        <td style="color:black;background-color:#F8F8F8">置换补贴(元)</td>
                        <td class="td-value2 moreList" data-table="t_dvc_displace" data-column="replacementSubsidy"
                            data-type='1'>
                            <input v-if="showInput('置换补贴')" style="width: 100%;border: 0px" type="text"
                                   @blur="strFormat($event.target,'displace.replacementSubsidy')"
                                   @focus="strFormatF($event.target,'displace.replacementSubsidy')"
                                   v-onedate="fmoney(displace.replacementSubsidy)"
                            />
                            <span v-else class="pull-left" style="margin-left:0px">{{fmoney(displace.replacementSubsidy)}}</span>
                            <!--<span style="position:absolute;left:170px;top: 3px;">元</span>-->
                        </td>
                    </tr>
                    <tr class="" style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">亏损(元)</td>
                        <td class="td-value2 moreList" data-table="t_dvc_displace" data-column="lossMoney"
                            data-type='1'>
                            <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                                   @blur="strFormat($event.target,'displace.lossMoney')"
                                   @focus="strFormatF($event.target,'displace.lossMoney')"
                                   v-onedate="fmoney(displace.lossMoney)"
                            />
                            <span v-else class="pull-left"
                                  style="margin-left:0px;">{{fmoney(displace.lossMoney)!=0?displace.lossMoney:"未出售"}}</span>
                            <!--<span style="position:absolute;left:170px;top: 3px;">元</span>-->
                        </td>
                        <td style="color:black;background-color:#F8F8F8">资金占用费(元)</td>
                        <td class="td-value2 moreList" data-table="t_dvc_displace" data-column="fundPossessionCost" data-type='1'>
                            <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                                   @blur="strFormat($event.target,'displace.fundPossessionCost')"
                                   @focus="strFormatF($event.target,'displace.fundPossessionCost')"
                                   v-onedate="fmoney(displace.fundPossessionCost)"
                            />
                            <!--<span class="pull-left" style="margin-left:0px">{{displace.fundPossessionCost!=0?fmoney(displace.fundPossessionCost):""}}</span>-->
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">合同/发票/合格证</td>
                        <td colspan="2">
                            <div id="divUploadedFiles">
                                <div class="fj-tanzhongStyle " v-for="(attach,i) in displace.attaches">
                                    <b :class="fjStyle(attach.name)"></b>
                                    <div class="name" v-if="attach.name" :title="attach.name"
                                         v-on:click="download(attach.url,attach.name)">{{attach.name}}
                                    </div>
                                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                         v-on:click="download(attach.url,attach.name)">下载</a></div>
                                    <div class="del" v-if="pageType!='look'&&attach.name"><a href="javascript:void(0)"
                                                                                             class="nui-txt-link"
                                                                                             @click.stop="deleteFileMore('hetong',i)">删除</a>
                                    </div>
                                    <!--<div class="info">11.35K <span class="nui-txt-suc">上传完成</span></div>-->
                                </div>
                            </div>
                        </td>
                        <td>
                            <div id="divUpload" v-if="showInput('合同')">
                                上传附件
                            </div>
                        </td>
                    </tr>
                    <tr style="height:30px">
                        <td class="td-title" rowspan="2" style="line-height: 48px;">备注</td>
                        <td rowspan="2" colspan="3" class="td-value2 moreList" data-table="t_dvc_displace"
                            data-column="remark" data-type='1'>
                            <textarea class="text-left" style="box-shadow: inset 1px 1px 4px #333;
                              width: 100%;height: 100%; position: absolute;top: 0;left: 0;" type="text"
                                      v-model="displace.remark" v-if="showInput('备注')"><!--v-if="pageType=='edit'"-->
                            </textarea>
                            <span v-else class="lineOne">{{displace.remark}}</span>
                        </td>
                    </tr>
                    <tr>
                    </tr>
                </table>
                <!--运输信息-->
                <table class="table  table-bordered text-center" id="displace">
                    <tr class="no-print">
                        <td colspan="6" class=" no-print title" style="background: #d3e8fd !important;color: black !important;">运输信息
                            <a href="javascript:void(0)"
                               v-if="pageType=='edit'&&change==0&&isAdd==0&&displace.state!='库存'&&displace.state!='已交'&&displace.state!='已退货'"
                               style="height: 22px;position: absolute;right: 0px;color:black;"
                               @click="changeTransport()">增加物流变更信息
                            </a>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="width: 17%;" class="td-title">出发地</td>
                        <td style="" class="td-value2">
                            <input type="text" v-model="displace.departure" v-if="showInput('0')">
                            <span v-else>{{displace.departure}}</span>
                        </td>
                        <td style="width: 17%;" class="td-title">联系人</td>
                        <td style="" class="td-value2"><input type="text"
                                                              v-model="displace.departureContactName"
                                                              v-if="showInput('0')">
                            <span v-else>{{displace.departureContactName}}</span>
                        </td>
                        <td style="width: 17%;" class="td-title">电话</td>
                        <td style="" class="td-value2"><input type="text"
                                                              v-model="displace.departureContactTel"
                                                              v-if="showInput('0')">
                            <span v-else>{{displace.departureContactTel}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="color:black;background-color:#F8F8F8">目的地</td>
                        <td style="width: 17%;" class="td-value2">
                            <input type="text" v-model="displace.destination" v-if="showInput('0')">
                            <span v-else>{{displace.destination}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">联系人</td>
                        <td style="width: 17%;" class="td-value2"><input type="text"
                                                                         v-model="displace.destinationContactName"
                                                                         v-if="showInput('0')">
                            <span v-else>{{displace.destinationContactName}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">电话</td>
                        <td style="width: 17%;" class="td-value2"><input type="text"
                                                                         v-model="displace.destinationContactTel"
                                                                         v-if="showInput('0')">
                            <span v-else>{{displace.destinationContactTel}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="color:black;background-color:#F8F8F8">运输公司</td>
                        <td style="width: 17%;" class="td-value2">
                            <input type="text" id="traCompany" v-model="displace.transportCompany" v-if="showInput('0')"
                                   @click="getTraCom"
                                   showList="true">
                            <span v-else>{{displace.transportCompany}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">联系人</td>
                        <td style="width: 17%;" class="td-value2"><input type="text"
                                                                         v-model="displace.traComContactName"
                                                                         v-if="showInput('0')">
                            <span v-else>{{displace.traComContactName}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">电话</td>
                        <td style="width: 17%;" class="td-value2"><input type="text" v-model="displace.traComContactTel"
                                                                         v-if="showInput('0')">
                            <span v-else>{{displace.traComContactTel}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="color:black;background-color:#F8F8F8">板车车牌</td>
                        <td style="width: 17%;" class="td-value2">
                            <input type="text" v-model="displace.modelCarLicense" v-if="showInput('0')">
                            <span v-else>{{displace.modelCarLicense}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">司机姓名</td>
                        <td style="width: 17%;" class="td-value2"><input type="text" v-model="displace.driverName"
                                                                         v-if="showInput('0')">
                            <span v-else>{{displace.driverName}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">司机电话</td>
                        <td style="width: 17%;" class="td-value2"><input type="text" v-model="displace.driverTel"
                                                                         v-if="showInput('0')">
                            <span v-else>{{displace.driverTel}}</span>
                        </td>
                    </tr>
                    <tr style="height:30px;">
                        <td style="color:black;background-color:#F8F8F8">运费(含专票)/元</td>
                        <td style="width: 17%;" class="td-value2">
                            <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                                   @blur="strFormat($event.target,'displace.freight')"
                                   @focus="strFormatF($event.target,'displace.freight')"
                                   v-onedate="fmoney(displace.freight)"
                            />
                            <span v-else class="pull-left" style="margin-left:0px">{{fmoney(displace.freight)}}</span>
                            <!--<span style="position:absolute;left:125px;top: 3px;">元</span>-->
                        </td>
                        <td style="color:black;background-color:#F8F8F8">扣款(元)</td>
                        <td style="width: 17%;" class="td-value2 moreList" data-table="t_dvc_displace"
                            data-column="deduction" data-type='1'>
                            <input v-if="showInput('扣款')" style="width: 100%;border: 0px" type="text"
                                   @blur="strFormat($event.target,'displace.deduction')"
                                   @focus="strFormatF($event.target,'displace.deduction')"
                                   v-onedate="fmoney(displace.deduction)"
                            />
                            <span v-else class="pull-left"
                                  style="margin-left:0px">{{fmoney(displace.deduction)}}</span>
                            <!--<span style="position:absolute;left:125px;top: 3px;">元</span>-->
                        </td>
                        <td style="color:black;background-color:#F8F8F8">扣款说明</td>
                        <td style="width: 17%;" class="td-value2 moreList" data-table="t_dvc_displace"
                            data-column="deductionInstructions" data-type='1'>
                            <input type="text" v-model="displace.deductionInstructions" v-if="showInput('扣款说明')">
                            <span v-else>{{displace.deductionInstructions}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="color:black;background-color:#F8F8F8">司机证件</td>
                        <td style="width: 17%;">
                            <div id="divUploadedFiles">
                                <div class="fj-tanzhongStyle fj-one-tanzhongStyle"
                                     v-if="displace.driverCertificateName">
                                    <b :class="fjStyle(displace.driverCertificateName)"></b>
                                    <div class="name" style="width: 165px;" :title="displace.driverCertificateName"
                                         v-on:click="download(displace.driverCertificateUrl,displace.driverCertificateName)">
                                        {{displace.driverCertificateName}}
                                    </div>
                                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                         v-on:click="download(displace.driverCertificateUrl,displace.driverCertificateName)">下载</a>
                                    </div>
                                    <div class="del" v-if="pageType!='look'&&displace.driverCertificateName"><a
                                            href="javascript:void(0)" class="nui-txt-link"
                                            @click="deleteFile('driverCertificate')">删除</a></div>
                                </div>
                                <span v-else-if="pageType=='look'" class="pull-left" style="margin-left: 10px">无</span>
                            </div>
                            <div v-if="showInput('司机证件')"
                                 :class="(pageType=='look'||displace.driverCertificateName!='')?'fujian fj noFujian':'fujian fj'"
                                 id="driverCertificate">上传附件
                            </div>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">板车及设备照片</td>
                        <td style="width: 17%;" colspan="2">

                            <div id="divUploadedFiles">
                                <div class="fj-tanzhongStyle " v-for="(attach,i) in displace.devicePictures">
                                    <b :class="fjStyle(attach.name)"></b>
                                    <div class="name" v-if="attach.name" :title="attach.name"
                                         v-on:click="download(attach.url,attach.name)">{{attach.name}}
                                    </div>
                                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                         v-on:click="download(attach.url,attach.name)">下载</a></div>
                                    <div class="del" v-if="pageType!='look'&&attach.name"><a href="javascript:void(0)"
                                                                                             class="nui-txt-link"
                                                                                             @click.stop="deleteFileMore('devicePictures',i)">删除</a>
                                    </div>
                                    <!--<div class="info">11.35K <span class="nui-txt-suc">上传完成</span></div>-->
                                </div>
                            </div>
                        </td>
                        <td>
                            <div id="devicePictures" class="fj" v-if="showInput('板车及设备照片')">
                                上传附件
                            </div>
                        </td>
                    </tr>
                </table>
                <!--&lt;!&ndash;物流变更信息&ndash;&gt;
                <table class="table  table-bordered text-center" id="transportChange"
                       :style="(change==1||displace.transportState==1)?'display:block;':'display:none'">
                  <tr>
                    <td colspan="6" style="min-width: 300px;width:1155px;height: 30px" class="title">
                        <span style="text-align:center;height:18px;">物流变更</span>
                        &lt;!&ndash;<span class="btn  btn-sm" style="color:#2a8cec;position: relative;left: 350px;"
                              @click="deleteChange()" v-if="displace.transportState==0">X</span>&ndash;&gt;
                    </td>
                  </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="width: 17%;" class="td-title"><i class="biTian">*</i>变更原因</td>
                        <td style="" class="td-value2">
                            <input type="text" v-model="transportChange.changeReason" v-if="pageType=='edit'">
                            <span v-else>{{transportChange.changeReason}}</span>
                        </td>
                        <td style="width: 17%;" class="td-title">新出发地</td>
                        <td style="" class="td-value2"><input type="text"
                                                              v-model="transportChange.newDeparture"
                                                              v-if="pageType=='edit'">
                            <span v-else>{{transportChange.newDeparture}}</span>
                        </td>
                        <td style="width: 17%;" class="td-title">目的地</td>
                        <td style="" class="td-value2"><input type="text"
                                                              v-model="transportChange.destination"
                                                              v-if="pageType=='edit'">
                            <span v-else>{{transportChange.destination}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="color:black;background-color:#F8F8F8">运输公司</td>
                        <td style="width: 17%;" class="td-value2">
                            <input type="text" v-model="transportChange.transportCompany" v-if="pageType=='edit'"
                                   @click="getTraCom"
                                   id="changeTraCompany" showlist="true">
                            <span v-else>{{transportChange.transportCompany}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">运输公司联系人</td>
                        <td style="width: 17%;" class="td-value2"><input type="text"
                                                                         v-model="transportChange.traComContactName"
                                                                         v-if="pageType=='edit'">
                            <span v-else>{{transportChange.traComContactName}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">电话</td>
                        <td style="width: 17%;" class="td-value2"><input type="text"
                                                                         v-model="transportChange.traComContactTel"
                                                                         v-if="pageType=='edit'">
                            <span v-else>{{transportChange.traComContactTel}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="color:black;background-color:#F8F8F8">板车车牌</td>
                        <td style="width: 17%;" class="td-value2">
                            <input type="text" v-model="transportChange.modelCarLicense" v-if="pageType=='edit'">
                            <span v-else>{{transportChange.modelCarLicense}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">司机姓名</td>
                        <td style="width: 17%;" class="td-value2"><input type="text"
                                                                         v-model="transportChange.driverName"
                                                                         v-if="pageType=='edit'">
                            <span v-else>{{transportChange.driverName}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">司机电话</td>
                        <td style="width: 17%;" class="td-value2"><input type="text" v-model="transportChange.driverTel"
                                                                         v-if="pageType=='edit'">
                            <span v-else>{{transportChange.driverTel}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="color:black;background-color:#F8F8F8">运费(含专票)/元</td>
                        <td style="width: 17%;" class="td-value2">
                            <input v-if="pageType=='edit'" style="width: 100%;border: 0px" type="text"
                                   @blur="strFormat($event.target,'transportChange.freight')"
                                   @focus="strFormatF($event.target,'transportChange.freight')"
                                   v-onedate="fmoney(transportChange.freight)"
                            />
                            <span v-else class="pull-left"
                                  style="margin-left:0px">{{fmoney(transportChange.freight)}}</span>
                            <span style="position:absolute;left:125px;top: 3px;">元</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">扣款</td>
                        <td style="width: 17%;" class="td-value2">
                            <input v-if="pageType=='edit'" style="width: 100%;border: 0px" type="text"
                                   @blur="strFormat($event.target,'transportChange.deduction')"
                                   @focus="strFormatF($event.target,'transportChange.deduction')"
                                   v-onedate="fmoney(transportChange.deduction)"
                            />
                            <span v-else class="pull-left"
                                  style="margin-left:0px">{{fmoney(transportChange.deduction)}}</span>
                            <span style="position:absolute;left:125px;top: 3px;">元</span>

                        </td>
                        <td style="color:black;background-color:#F8F8F8">扣款说明</td>
                        <td style="width: 17%;" class="td-value2"><input type="text"
                                                                         v-model="transportChange.deductionInstructions"
                                                                         v-if="pageType=='edit'">
                            <span v-else>{{transportChange.deductionInstructions}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="color:black;background-color:#F8F8F8">司机证件</td>
                        <td style="width: 17%;">
                            <div id="divUploadedFiles">
                                <div class="fj-tanzhongStyle fj-one-tanzhongStyle"
                                     v-if="transportChange.cdriverCertificateName">
                                    <b :class="fjStyle(transportChange.cdriverCertificateName)"></b>
                                    <div class="name" style="width: 165px;" title="attach.name"
                                         v-on:click="download(transportChange.cdriverCertificateUrl,transportChange.cdriverCertificateName)">
                                        {{transportChange.cdriverCertificateName}}
                                    </div>
                                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                         v-on:click="download(transportChange.cdriverCertificateUrl,transportChange.cdriverCertificateName)">下载</a>
                                    </div>
                                    <div class="del"
                                         v-if="pageType!='look'&&transportChange.cdriverCertificateName&&isAdd==1"><a
                                            href="javascript:void(0)" class="nui-txt-link"
                                            @click.stop="deleteFileTransportChange('cdriverCertificate')">删除</a></div>
                                </div>
                                <span v-else-if="pageType=='look'" class="pull-left" style="margin-left: 10px">无</span>
                            </div>
                            <div :class="(pageType=='look'||transportChange.cdriverCertificateName!='')?'fujian fj2 noFujian':'fujian fj2'"
                                 id="cdriverCertificate">上传附件
                            </div>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">板车及设备照片</td>
                        <td style="width: 17%;" colspan="3">
                            <div id="divUploadedFiles">
                                <div class="fj-tanzhongStyle fj-one-tanzhongStyle"
                                     v-if="transportChange.cdevicePhotoName">
                                    <b :class="fjStyle(transportChange.cdevicePhotoName)"></b>
                                    <div class="name" style="width: 165px;" title="attach.name"
                                         v-on:click="download(transportChange.cdevicePhotoUrl,transportChange.cdevicePhotoName)">
                                        {{transportChange.cdevicePhotoName}}
                                    </div>
                                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                         v-on:click="download(transportChange.cdevicePhotoUrl,transportChange.cdevicePhotoName)">下载</a>
                                    </div>
                                    <div class="del"
                                         v-if="pageType!='look'&&transportChange.cdevicePhotoName&&isAdd==1"><a
                                            href="javascript:void(0)" class="nui-txt-link"
                                            @click.stop="deleteFileTransportChange('cdevicePhoto')">删除</a></div>
                                </div>
                                <span v-else-if="pageType=='look'" class="pull-left" style="margin-left: 10px">无</span>
                            </div>
                            <div :class="(pageType=='look'||transportChange.cdevicePhotoName!='')?'fujian fj2 noFujian':'fujian fj2'"
                                 id="cdevicePhoto">上传附件
                            </div>
                        </td>
                    </tr>
                </table>
                &lt;!&ndash;出库信息&ndash;&gt;
                <table class="table  table-bordered text-center" id="outBound"
                       :style="(outBound.main.type==0&&isAdd!=1)?'display:block;':'display:none'">
                    <tr>
                    <td colspan="6" class=" no-print title" style="width: 1366px">出库记录</td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="width: 17%;" class="td-title">出库类型</td>
                        <td style="" colspan="5" class="td-value2">
                            <span>出库</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="width: 17%;" class="td-title">销售合同</td>
                        <td style="" colspan="5" class="td-value2">
                            <span>{{outBound.contract.contractNo}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="width: 17%;" class="td-title">区域经理</td>
                        <td style="" class="td-value2">
                            <span>{{outBound.contract.regionManagerName}}</span>
                        </td>
                        <td style="width: 17%;" class="td-title">交付客户</td>
                        <td style="" class="td-value2">
                            <span>{{outBound.contract.buyer}}</span>
                        </td>
                        <td style="width:17%;" class="td-title">电话</td>
                        <td style="" class="td-value2">
                            <span>{{outBound.contract.buyerTel}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="width: 17%;" class="td-title">提车地址</td>
                        <td style="" class="td-value2">
                            <span>{{outBound.main.pickUpAddress}}</span>
                        </td>
                        <td style="width: 17%;" class="td-title">联系人</td>
                        <td style="" class="td-value2">
                            <span>{{outBound.main.pickUpContacts}}</span>
                        </td>
                        <td style="width:17%;" class="td-title">电话</td>
                        <td style="" class="td-value2">
                            <span>{{outBound.main.pickUpTelephone}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="width: 211px;" class="td-title">交车地址</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{outBound.main.delivery_address}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">联系人</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{outBound.main.deliveryContacts}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">电话</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{outBound.main.deliveryTelephone}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="color:black;background-color:#F8F8F8">运输公司</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{outBound.main.transport_company }}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">联系人</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{outBound.main.contacts}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">电话</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{outBound.main.telephone}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="color:black;background-color:#F8F8F8">板车车牌</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{outBound.main.dray_license}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">司机姓名</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{outBound.main.driver_name}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">司机电话</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{outBound.main.driver_tel}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="color:black;background-color:#F8F8F8">运费(含专票)/元</td>
                        <td style="width: 17%;" class="td-value2">
                            <span class="pull-left"
                                  style="margin-left: 10px">{{fmoney(outBound.main.special_fee)}}</span>
                            <span style="position:absolute;left:125px;top: 3px;">元</span>

                        </td>
                        <td style="color:black;background-color:#F8F8F8">扣款</td>
                        <td style="width: 17%;" class="td-value2">
                            <span class="pull-left"
                                  style="margin-left: 10px">{{fmoney(outBound.main.deduction_fee)}}</span>
                            <span style="position:absolute;left:125px;top: 3px;">元</span>

                        </td>
                        <td style="color:black;background-color:#F8F8F8">扣款说明</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{outBound.main.deduction_remark}}</span>
                        </td>
                    </tr>
                    &lt;!&ndash;司机证件&ndash;&gt;
                    <tr class="td-row2 td-value" style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">司机证件</td>
                        <td colspan="5">
                            <div id="divUploadedFiles1">
                                <div class="fj-tanzhongStyle " v-for="(attach,i) in outBound.certificates">
                                    <b :class="fjStyle(attach.name)"></b>
                                    <div class="name" v-if="attach.name" title="attach.name"
                                         v-on:click="download(attach.url,attach.name)">{{attach.name}}
                                    </div>
                                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                         v-on:click="download(attach.url,attach.name)">下载</a></div>
                                    <div class="del" v-if="showInput('0')"><a href="javascript:void(0)"
                                                                              class="nui-txt-link"
                                                                              @click.stop="deleteFileMoreDriverCertificate(i)">删除</a>
                                    </div>
                                    &lt;!&ndash;<div class="info">11.35K <span class="nui-txt-suc">上传完成</span></div>&ndash;&gt;
                                </div>
                            </div>
                        </td>
                    </tr>
                    &lt;!&ndash;设备照片&ndash;&gt;
                    <tr class="td-row2 td-value" style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">板车及设备照片</td>
                        <td colspan="5">
                            <div id="divUploadedFiles2">
                                <div class="fj-tanzhongStyle " v-for="(attach,i) in outBound.devicePictures">
                                    <b :class="fjStyle(attach.name)"></b>
                                    <div class="name" v-if="attach.name" title="attach.name"
                                         v-on:click="download(attach.url,attach.name)">{{attach.name}}
                                    </div>
                                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                         v-on:click="download(attach.url,attach.name)">下载</a></div>
                                    <div class="del" v-if="showInput('0')"><a href="javascript:void(0)"
                                                                              class="nui-txt-link"
                                                                              @click.stop="deleteFileMoreDevicePhoto(i)">删除</a>
                                    </div>
                                    &lt;!&ndash;<div class="info">11.35K <span class="nui-txt-suc">上传完成</span></div>&ndash;&gt;
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
                <table class="table  table-bordered text-center" id="moveBound"
                       :style="(moveBound.main.type==1&&isAdd!=1)?'display:block;':'display:none'">
                  <tr>
                    <td colspan="6" style="min-width: 300px;width:1155px;height: 30px;" class="title"
                    >
                        <span style="text-align:center;height:18px;">移库记录</span>
                    </td>
                  </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="width: 17%;" class="td-title">出库类型</td>
                        <td style="" colspan="5" class="td-value2">
                            <span>移库</span>
                        </td>
                    </tr>

                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="" class="td-title">提车地址</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{moveBound.main.pickUpAddress}}</span>
                        </td>
                        <td style="width: 17%" class="td-title">联系人</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{moveBound.main.pickUpContacts}}</span>
                        </td>
                        <td style="width: 17%" class="td-title">电话</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{moveBound.main.pickUpTelephone}}</span>
                        </td>
                    </tr>

                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="width: 211px;" class="td-title">新库存地</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{moveBound.main.delivery_address}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">联系人</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{moveBound.main.deliveryContacts}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">电话</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{moveBound.main.deliveryTelephone}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="color:black;background-color:#F8F8F8">运输公司</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{moveBound.main.transport_company }}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">联系人</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{moveBound.main.contacts}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">电话</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{moveBound.main.telephone}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="color:black;background-color:#F8F8F8">板车车牌</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{moveBound.main.dray_license}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">司机姓名</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{moveBound.main.driver_name}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">司机电话</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{moveBound.main.driver_tel}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="color:black;background-color:#F8F8F8">运费(含专票)/元</td>
                        <td style="width: 17%;" class="td-value2">
                            <span class="pull-left"
                                  style="margin-left: 10px">{{fmoney(moveBound.main.special_fee)}}</span>
                            <span style="position:absolute;left:125px;top: 3px;">元</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">扣款</td>
                        <td style="width: 17%;" class="td-value2">
                            <span class="pull-left"
                                  style="margin-left: 10px">{{fmoney(moveBound.main.deduction_fee)}}</span>
                            <span style="position:absolute;left:125px;top: 3px;">元</span>

                        </td>
                        <td style="color:black;background-color:#F8F8F8">扣款说明</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{moveBound.main.deduction_remark}}</span>
                        </td>
                    </tr>
                    &lt;!&ndash;司机证件&ndash;&gt;
                    <tr class="td-row2 td-value" style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">司机证件</td>
                        <td colspan="5">
                            <div id="divUploadedFiles1">
                                <div class="fj-tanzhongStyle " v-for="(attach,i) in moveBound.certificates">
                                    <b :class="fjStyle(attach.name)"></b>
                                    <div class="name" v-if="attach.name" title="attach.name"
                                         v-on:click="download(attach.url,attach.name)">{{attach.name}}
                                    </div>
                                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                         v-on:click="download(attach.url,attach.name)">下载</a></div>
                                    <div class="del" v-if="showInput('0')"><a href="javascript:void(0)"
                                                                              class="nui-txt-link"
                                                                              @click.stop="deleteFileMoreDriverCertificate(i)">删除</a>
                                    </div>
                                    &lt;!&ndash;<div class="info">11.35K <span class="nui-txt-suc">上传完成</span></div>&ndash;&gt;
                                </div>
                            </div>
                        </td>
                    </tr>
                    &lt;!&ndash;设备照片&ndash;&gt;
                    <tr class="td-row2 td-value" style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">板车及设备照片</td>
                        <td colspan="5">
                            <div id="divUploadedFiles2">
                                <div class="fj-tanzhongStyle " v-for="(attach,i) in moveBound.devicePictures">
                                    <b :class="fjStyle(attach.name)"></b>
                                    <div class="name" v-if="attach.name" title="attach.name"
                                         v-on:click="download(attach.url,attach.name)">{{attach.name}}
                                    </div>
                                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                         v-on:click="download(attach.url,attach.name)">下载</a></div>
                                    <div class="del" v-if="showInput('0')"><a href="javascript:void(0)"
                                                                              class="nui-txt-link"
                                                                              @click.stop="deleteFileMoreDevicePhoto(i)">删除</a>
                                    </div>
                                    &lt;!&ndash;<div class="info">11.35K <span class="nui-txt-suc">上传完成</span></div>&ndash;&gt;
                                </div>

                            </div>
                        </td>
                    </tr>
                </table>
                <table class="table  table-bordered text-center" id="returnBound"
                       :style="(returnBound.main.type==2&&isAdd!=1)?'display:block;':'display:none'">
                   <tr>
                    <td colspan="6" style="min-width: 300px;width:1155px;height: 30px;" class="title">
                        <span style="text-align:center;height:18px;">退货记录</span>
                    </td>
                   </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="width: 17%;" class="td-title">出库类型</td>
                        <td style="" colspan="5" class="td-value2">
                            <span>退货</span>
                        </td>
                    </tr>

                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="width: 17%;" class="td-title">提车地址</td>
                        <td style="" class="td-value2">
                            <span>{{returnBound.main.pickUpAddress}}</span>
                        </td>
                        <td style="width: 17%" class="td-title">联系人</td>
                        <td style="" class="td-value2">
                            <span>{{returnBound.main.pickUpContacts}}</span>
                        </td>
                        <td style="width: 17%" class="td-title">电话</td>
                        <td style=";" class="td-value2">
                            <span>{{returnBound.main.pickUpTelephone}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="width: 211px;" class="td-title">退库地址</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{returnBound.main.delivery_address}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">联系人</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{returnBound.main.deliveryContacts}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">电话</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{returnBound.main.deliveryTelephone}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="color:black;background-color:#F8F8F8">运输公司</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{returnBound.main.transport_company }}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">联系人</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{returnBound.main.contacts}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">电话</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{returnBound.main.telephone}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="color:black;background-color:#F8F8F8">板车车牌</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{returnBound.main.dray_license}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">司机姓名</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{returnBound.main.driver_name}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">司机电话</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{returnBound.main.driver_tel}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="color:black;background-color:#F8F8F8">运费(含专票)/元</td>
                        <td style="width: 17%;" class="td-value2">
                            <span class="pull-left"
                                  style="margin-left: 10px">{{fmoney(returnBound.main.special_fee)}}</span>
                            <span style="position:absolute;left:125px;top: 3px;">元</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">扣款</td>
                        <td style="width: 17%;" class="td-value2">
                            <span class="pull-left"
                                  style="margin-left: 10px">{{fmoney(returnBound.main.deduction_fee)}}</span>
                            <span style="position:absolute;left:125px;top: 3px;">元</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">扣款说明</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{returnBound.main.deduction_remark}}</span>
                        </td>
                    </tr>
                    &lt;!&ndash;司机证件&ndash;&gt;
                    <tr class="td-row2 td-value" style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">司机证件</td>
                        <td colspan="5">
                            <div id="divUploadedFiles1">
                                <div class="fj-tanzhongStyle " v-for="(attach,i) in returnBound.certificates">
                                    <b :class="fjStyle(attach.name)"></b>
                                    <div class="name" v-if="attach.name" title="attach.name"
                                         v-on:click="download(attach.url,attach.name)">{{attach.name}}
                                    </div>
                                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                         v-on:click="download(attach.url,attach.name)">下载</a></div>
                                    <div class="del" v-if="showInput('0')"><a href="javascript:void(0)"
                                                                              class="nui-txt-link"
                                                                              @click.stop="deleteFileMoreDriverCertificate(i)">删除</a>
                                    </div>
                                    &lt;!&ndash;<div class="info">11.35K <span class="nui-txt-suc">上传完成</span></div>&ndash;&gt;
                                </div>
                            </div>
                        </td>
                    </tr>
                    &lt;!&ndash;设备照片&ndash;&gt;
                    <tr class="td-row2 td-value" style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">设备照片</td>
                        <td colspan="5">
                            <div id="divUploadedFiles2">
                                <div class="fj-tanzhongStyle " v-for="(attach,i) in returnBound.devicePictures">
                                    <b :class="fjStyle(attach.name)"></b>
                                    <div class="name" v-if="attach.name" title="attach.name"
                                         v-on:click="download(attach.url,attach.name)">{{attach.name}}
                                    </div>
                                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                         v-on:click="download(attach.url,attach.name)">下载</a></div>
                                    <div class="del" v-if="showInput('0')"><a href="javascript:void(0)"
                                                                              class="nui-txt-link"
                                                                              @click.stop="deleteFileMoreDevicePhoto(i)">删除</a>
                                    </div>
                                    &lt;!&ndash;<div class="info">11.35K <span class="nui-txt-suc">上传完成</span></div>&ndash;&gt;
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
                &lt;!&ndash;审批进度&ndash;&gt;
                <table class="table-detail no-print" style="border-top-width:0px;"
                       v-if="displace.auditId!=''">
                    <tr>
                        <td class="no-print title" colspan="4" style="height: 24px">审批进度</td>
                    </tr>
                    <tr>
                        <td class="td-title" style="width:17%;">审核人员</td>
                        <td class="td-title" style="width:16%;">审核状态</td>
                        <td class="td-title" style="width:17%;">审核时间</td>
                        <td class="td-title">审核意见</td>
                    </tr>
                    &lt;!&ndash;<tr v-for="itemAudit in auditHistorys">
                        <td><span>{{itemAudit.auditorName}}</span></td>
                        <td><span>{{convertAuditFlagToNameNew(itemAudit.auditFlag)}}</span></td>
                        <td><span>{{itemAudit.auditTime}}</span></td>
                        <td><span>{{itemAudit.auditAdvise}}</span></td>
                    </tr>&ndash;&gt;
                    <tr>
                        <td>
                            <span>{{displace.auditName}}-{{displace.auditRoleName}}</span>
                        </td>
                        <td>
                            <span v-if="displace.auditFlag==0" style="color:red;">{{convertAuditFlagToName(displace.auditFlag)}}</span>
                            <span v-else>{{convertAuditFlagToName(displace.auditFlag)}}</span>
                        </td>
                        <td>
                            <span v-if="displace.auditFlag==0"></span>
                            <span v-else>{{displace.auditTime}}</span>
                        </td>
                        <td>
                            &lt;!&ndash; <input type="text" v-model="displace.auditAdvise" v-if="pageType=='audit'"/>&ndash;&gt;
                            <span>{{displace.auditAdvise}}</span>
                        </td>
                    </tr>
                </table>-->
                <div class="south no-print" style="height:50px;line-height:50px;text-align:center;">
                    <input type="button" id="saveDraft" class="btn oaBtn btn-sm" @click="save(-1)" value="保存草稿">

                    <input type="button" id="save" class="btn oaBtn btn-sm" @click="save(1)" value="提交">
                </div>
            </div>
        </div>

    </div>

</section>

</body>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=0b5caf39"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=0c4d95a9"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<!--ztree组件所需js-->
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.exhide-3.5.js"></script>
<script src="/dist/plugins/webuploader-0.1.5/webuploader.min.js"></script>
<script type="text/javascript" src="/dist/js/pages/common/commonService.js"></script>
<script type="text/javascript" src="/dist/js/pages/common/changeMoneyToChinese.js"></script>
<script type="text/javascript" src="/dist/plugins/print/print.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script src="/dist/js/pages/wreport/Template.js?t=42e28def"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
    $(function () {
        $("body").on("click", ".moreList", function (e) {
            var tableName = $(this).attr("data-table");
            var column = $(this).attr("data-column");
            var columnName = $(this).attr("data-columnName");
            var mainKey = $(this).attr("data-column");
            var mid = $(this).attr("data-mid");
            var type = $(this).attr("data-type");
            if ($(this).hasClass("jiaobiao3")) {
                $.dialog({
                    content: 'url:/page/logs/logs.html?tableName=' + tableName + '&column=' + column + '&columnName=' + columnName + "&mainKey=" + mainKey + "&mid=" + mid + '&type=' + type + '&id=' + app.displace.id,
                    title: '修改日志',
                    width: 600,
                    height: 500,
                    max: false,
                    min: false,
                    lock: true
                });
            }
        });
        $("body").on("click", ".moreListData", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".moreListData").hide();
        });
    });
</script>
<script type="text/javascript">
    // var api = frameElement.api, W = api.opener;
    Vue.directive('onedate', {
        // 当被绑定的元素插入到 DOM 中时……
        update: function (el, binding) {
            // 聚焦元素
            if (app.pageType == 'edit') {
                if (el.value == "NaN.undefined" || el.value == "") {
                    if(binding.value==0){
                        el.value=0
                    }
                    el.value = binding.value
                }
            }
        },
        componentUpdated: function (el, binding) {
            // 聚焦元素
        }
    })
    var app = new Vue({
        el: '#app',
        data: {
            openType: $.wyui.page.urlParams.openType ? $.wyui.page.urlParams.openType : 'top',
            userId: getCurrentUser().id,
            time: new Date(),
            isAdd: $.wyui.page.urlParams.isAdd,
            pageType: $.wyui.page.urlParams.pageType,
            itemsType: [],
            itemsCom: [],
            stocks: [],
            selectCom: '',
            outType: 0,
            deviceAttach: [],
            regions: [],//区域
            bigRegionManager: [],//大区经理
            regionManager: [],//区域经理
            auditHistorys: [],//历史审核记录
            change: 0,
            deviceSources:[],
            deviceStatuss:[],
            displace: {
                originalCustomerName:'',//原车客户姓名
                originalCustomerTel:'',
                deviceSource:'',//设备来源
                deviceStatus:'',//设备状态
                whetherToClose:1,
                existFlag:1,
                id: $.wyui.page.urlParams.id,
                createUserId: getCurrentUser().id,
                createUserName: getCurrentUser().name,
                fkCompanyId: '',
                companyName: '',
                brandName: '',
                modelName: '',
                houseName: '',
                sequence: '',
                houseAddress: '',
                state: '',
                buildingNumber: '',
                area: '',
                remark: '',
                housesProperty: '',
                replacementPrice: '',
                replacementsName: '',
                estimatePrice: '',
                regionId: '',
                regionName: '',
                regionManagerId: '',
                regionManagerName: '',
                bigregionManagerId: '',
                bigregionManagerName: '',
                sellPrice: '',
                transfer: '',
                kilometers: '',
                storeAddress: '',
                type: '1',
                delFlag: '0',
                replacementType: '',
                deviceAnnexName: '',
                deviceAnnexUrl: '',
                squence: '',
                replacementSubsidy: '',
                attaches: [],//附件
                devicePictures: [],//设备照片
                //审核字段
                auditFlag: -1,
                auditId: '',
                auditName: '',
                auditRoleName: '',
                auditTime: '',
                auditAdvise: '',
                /*运输信息*/
                departure: '',
                departureContactName: '',
                departureContactTel: '',
                destination: '',
                destinationContactName: '',
                destinationContactTel: '',
                transportCompany: '',
                traComContactName: '',
                traComContactTel: '',
                modelCarLicense: '',
                driverName: '',
                driverTel: '',
                freight: '',
                deduction: '',
                deductionInstructions: '',
                modelCarPhotoName: '',
                modelCarPhotoUrl: '',
                driverCertificateName: '',
                driverCertificateUrl: '',
                devicePhotoName: '',
                devicePhotoUrl: '',
                transportState: 0,
                customerName: '',
                replacementDeviceModelName: '',
                replacementDeviceBrandName: '',
                replacementDeviceSequence: '',
            },
            editAble:true,
        },
        methods: {
            getCompanyId:function (companyName,list) {
                var that=this;
                for(var i=0;i<list.length;i++){
                    if(list[i].name==companyName){
                        that.displace.fkCompanyId= list[i].id
                        //alert(displace.fkCompanyId)
                        return that.displace.fkCompanyId
                    }
                }
                debugger
                that.displace.regionName=''
                that.displace.bigregionManagerId='',
                that.displace.bigregionManagerName='',
                that.displace.regionManagerName=''
            },
            getAlert:function () {
                var that=this;
                if(that.displace.storeAddress){
                    if (that.displace.storeAddress.indexOf('省')==-1) {
                        alert("库存地格式不正确,请重新输入!")
                    }else if (that.displace.storeAddress.indexOf('市')==-1){
                        alert("库存地格式不正确,请重新输入!")
                    }
                }

            },
            inputFocus: function (id) {
                $("#" + id).focus();
            }
            ,
            showToday: function (updateTime) {
                var dateTime = new Date().Format("yyyy-MM-dd");
                if (dateTime == updateTime) {
                    return true;
                } else {
                    return false;
                }
            },
            fjStyle: function (fjName) {
                if (fjName) {
                    var type = fjName.substring(fjName.lastIndexOf('.') + 1);
                    return 'img fj-' + type
                }
                return 'img'
            },
            showInput: function (type) {
                var pageType = $.wyui.page.urlParams.pageType;
                //草稿、驳回状态可重新编辑
                var auditFlag = $.wyui.page.urlParams.auditFlag
                var state = $.wyui.page.urlParams.state;
                var that = this;
                if (auditFlag == "-1" || (auditFlag == "2" && state == '提车在途')) {
                    that.isAdd = 1;
                }
                if(pageType=='add'){
                    return true;
                }
            },
            save: function (auditFlag) {
                var that = this;
                if ("" == that.displace.companyName) {
                    alert("请输入归属公司")
                    return;
                }
                if ("" == that.displace.brandName) {
                    alert("请输入品牌")
                    return;
                }
                if ("" == that.displace.replacementType) {
                    alert("请输入设备类型")
                    return;
                }
                if ("" == that.displace.modelName) {
                    alert("请输入机型")
                    return;
                }
                if ("" == that.displace.state) {
                    alert("请输入状态")
                    return;
                }
                if (that.displace.departureContactTel != "") {
                    if (that.displace.departureContactTel.length != 11) {
                        alert("出发地手机号格式不正确");
                        return false;
                    }
                }
                if (that.displace.destinationContactTel != "") {
                    if (that.displace.destinationContactTel.length != 11) {
                        alert("目的地手机号格式不正确");
                        return false;
                    }
                }
                if (that.displace.traComContactTel != "") {
                    if (that.displace.traComContactTel.length != 11) {
                        alert("运输公司手机号格式不正确");
                        return false;
                    }
                }
                if (that.displace.driverTel != "") {
                    if (that.displace.driverTel.length != 11) {
                        alert("司机电话手机号格式不正确");
                        return false;
                    }
                }
                if(that.editAble==false){
                    return;
                }
                that.editAble = false;
                if (!that.displace.estimatePrice) {
                    that.displace.estimatePrice = 0.00
                }
                if (!that.displace.replacementPrice) {
                    that.displace.replacementPrice = 0.00
                }
                if (!that.displace.sellPrice) {
                    that.displace.sellPrice = 0.00
                }
                if (!that.displace.replacementSubsidy) {
                    that.displace.replacementSubsidy = 0.00
                }
                if (!that.displace.freight) {
                    that.displace.freight = 0.00
                }
                if (!that.displace.deduction) {
                    that.displace.deduction = 0.00
                }
                that.displace.auditFlag = auditFlag;//审核状态
                that.displace.updateUserId = getCurrentUser().id;
                that.displace.updateUserName = getCurrentUser().name;
                $.wyui.postMethod('/deviceDisplace/saveNew.json',trimRN(that.displace),function (r) {
                    var records=r.records;
                    if (r.records == "保存成功") {
                        var title;
                        if(auditFlag=='1'){
                            title='添加成功';
                        }else{
                            title='保存草稿成功'
                        }
                        top.$.alert({
                            title: title,
                            content: '',
                            icon: '1', //1成功 2失败 3提示 不穿代表无图标
                            height: 180,
                            width: 300,

                            blankclose: true,//点击空白是否可关闭
                            cancel: "确定",
                            cancelCallback:function(em, opts){
                                em.remove()
                                opts.close && opts.close()
                                var pageId = top.getActivePageId();
                                var $iframe = top.findIframeByName("库存管理");
                                $iframe[0].contentWindow.$("#iframeBox")[0].contentWindow.app.sel();
                                top.closeTabByPageId(pageId);
                            }
                        })
                        return false;
                    } else if (r.records == "序列号已存在") {
                        alert("序列号已存在");
                        return false;
                    }
                })

            },
            getTraCom: function () {
                $("#traCompany").autoComplete({
                    url: server.ip + "/brandStrock/getTransportCompany.json",
                    render: function (users, panel) {
                        for (var i = 0; i < users.length; i++) {
                            $("<li></li>").data("autoComplete",
                                users[i]).html("<a>" + users[i].companyName + "&nbsp;&nbsp;&nbsp;" +
                                "(" + "&nbsp;" + users[i].contact + "-" + users[i].tel + "&nbsp;" + ") " + "</a>")
                                .appendTo(panel);
                        }
                    },
                    selected: function (user) {
                        app.displace.transportCompany = user.companyName;
                        app.displace.traComContactName = user.contact;
                        app.displace.traComContactTel = user.tel;
                        return false;
                    },
                    height: 210,
                    width: 320
                });
                $("#changeTraCompany").autoComplete({
                    url: server.ip + "/brandStrock/getTransportCompany.json",
                    render: function (users, panel) {
                        for (var i = 0; i < users.length; i++) {
                            $("<li></li>").data("autoComplete",
                                users[i]).html("<a>" + users[i].companyName + "&nbsp;&nbsp;&nbsp;" +
                                "(" + "&nbsp;" + users[i].contact + "-" + users[i].tel + "&nbsp;" + ") " + "</a>")
                                .appendTo(panel);
                        }
                    },
                    selected: function (user) {
                        app.transportChange.transportCompany = user.companyName;
                        app.transportChange.traComContactName = user.contact;
                        app.transportChange.traComContactTel = user.tel;
                        return false;
                    },
                    height: 210,
                    width: 320
                });
            },
            close: function () {
                api.close();
            },
            showDatePicker: function (e, index) {
                var that = this;
                console.log(index)
                WdatePicker({
                    onpicked: function (dp) {
                        that.customer.years = dp.cal.getNewDateStr();
                        return true;
                    }
                });
                $(e.target).blur();
            },
            deleteFile: function (item) {
                if (window.confirm("确定要删除该附件吗?")) {
                    console.log(item)
                    this.displace[item + "Name"] = "";
                    this.displace[item + "Url"] = "";
                    $("#" + item).show();
                }
            },
            deleteFileTransportChange: function (item) {
                if (window.confirm("确定要删除该附件吗?")) {
                    console.log(item)
                    this.transportChange[item + "Name"] = "";
                    this.transportChange[item + "Url"] = "";
                    $("#" + item).show();
                }
            },
            download: function (attachId, fileName) {
                downloadFile(attachId,fileName)
                return false;
            },

            changeTransport: function () {
                var that = this;
                that.change = 1;
                setTimeout(function () {
                    $(".fj2").each(function () {
                        var demo = $(this);
                        var name = demo.attr("id");
                        var nameValue = name + "Name";
                        console.log(name)
                        console.log(that.transportChange)
                        var uploader = WebUploader.create({
                            // 选完文件后，是否自动上传。
                            auto: true,
                            // swf文件路径
                            swf: "/statics/plugin/webuploader-0.1.5/Uploader.swf",
                            // 文件接收服务端。
                            server: server.fjIp + "/attach/uploadFile.json",
                            // 选择文件的按钮。可选。
                            // 内部根据当前运行是创建，可能是input元素，也可能是flash.
                            pick: '#' + demo.attr("id"),
                            duplicate: true
                        });

                        // 文件上传过程中创建进度条实时显示。
                        uploader.on('uploadProgress', function (file, percentage) {
                            console.log(percentage)
                            var $li = $('#' + file.id),
                                $percent = $li.find('.progress span');
                            // 避免重复创建
                            if (!$percent.length) {
                                $percent = $('<p class="progress"><span></span></p>')
                                    .appendTo($li)
                                    .find('span');
                            }
                            $percent.css('width', percentage * 100 + '%');
                        });
                        uploader.on("uploadStart", function () {
                            $("#progress").show();
                        });
                        uploader.on("uploadComplete", function () {
                            $("#progress").hide();
                        });
                        // 文件上传成功，给item添加成功class, 用样式标记上传成功。
                        uploader.on('uploadSuccess', function (file, response) {
                            console.log(demo);
                            var nameValue = name + "Name";
                            var urlValue = name + "Url";
                            if (name == 'cmodelCarPhoto' || name == 'cdriverCertificate' || name == 'cdevicePhoto') {
                                console.log(response)
                                app.transportChange[nameValue] = response.name;
                                app.transportChange[urlValue] = response.url;
                                console.log(app.transportChange)
                            } else {
                                app.displace[nameValue] = response.name;
                                app.displace[urlValue] = response.url;
                                console.log(app.displace)
                            }
                            $("#" + name).hide();
                        });
                        // 文件上传失败，显示上传出错。
                        uploader.on('uploadError', function (file) {
                            alert("上传失败！");
                        });

                    });
                }, 1000);

            },
            deleteChange: function () {
                var that = this;
                that.change = 0;
            },
            uploadMore: function () {
                //上传附件
                var that = this;
                this.uploader = WebUploader.create({
                    // 选完文件后，是否自动上传。
                    auto: true,
                    // swf文件路径
                    swf: "/statics/plugin/webuploader-0.1.5/Uploader.swf",
                    // 文件接收服务端。
                    server: server.fjIp + "/attach/uploadFile.json",
                    // 选择文件的按钮。可选。
                    // 内部根据当前运行是创建，可能是input元素，也可能是flash.
                    pick: '#divUpload',
                    duplicate: true
                });
                this.uploader.on("uploadStart", function () {
                    $("#progress").show();
                });
                this.uploader.on("uploadComplete", function () {
                    $("#progress").hide();
                });
                // 文件上传成功，给item添加成功class, 用样式标记上传成功。
                this.uploader.on('uploadSuccess', function (file, response) {
                    if (response._raw == "文件上传出错！") {
                        alert("文件上传出错！");
                    } else {
                        that.displace.attaches.push({
                            id: response.id,
                            name: response.name,
                            url: response.url
                        });
                    }
                });
                // 文件上传失败，显示上传出错。
                this.uploader.on('uploadError', function (file) {
                    alert("上传失败！");
                });
            },
            uploadOutMore: function () {
                //上传附件
                var that = this;
                this.uploader = WebUploader.create({
                    // 选完文件后，是否自动上传。
                    auto: true,
                    // swf文件路径
                    swf: "/statics/plugin/webuploader-0.1.5/Uploader.swf",
                    // 文件接收服务端。
                    server: server.fjIp + "/attach/uploadFile.json",
                    // 选择文件的按钮。可选。
                    // 内部根据当前运行是创建，可能是input元素，也可能是flash.
                    pick: '#divUpload1',
                    duplicate: true
                });
                this.uploader.on("uploadStart", function () {
                    $("#progress").show();
                });
                this.uploader.on("uploadComplete", function () {
                    $("#progress").hide();
                });
                // 文件上传成功，给item添加成功class, 用样式标记上传成功。
                this.uploader.on('uploadSuccess', function (file, response) {
                    if (response._raw == "文件上传出错！") {
                        alert("文件上传出错！");
                    } else {
                        that.outBound.certificates.push({
                            id: response.id,
                            name: response.name,
                            url: response.url
                        });
                    }
                });
                // 文件上传失败，显示上传出错。
                this.uploader.on('uploadError', function (file) {
                    alert("上传失败！");
                });

            },
            uploadOutMore2: function () {
                //上传附件
                var that = this;
                this.uploader = WebUploader.create({
                    // 选完文件后，是否自动上传。
                    auto: true,
                    // swf文件路径
                    swf: "/statics/plugin/webuploader-0.1.5/Uploader.swf",
                    // 文件接收服务端。
                    server: server.fjIp + "/attach/uploadFile.json",
                    // 选择文件的按钮。可选。
                    // 内部根据当前运行是创建，可能是input元素，也可能是flash.
                    pick: '#divUpload2',
                    duplicate: true
                });
                this.uploader.on("uploadStart", function () {
                    $("#progress").show();
                });
                this.uploader.on("uploadComplete", function () {
                    $("#progress").hide();
                });
                // 文件上传成功，给item添加成功class, 用样式标记上传成功。
                this.uploader.on('uploadSuccess', function (file, response) {
                    if (response._raw == "文件上传出错！") {
                        alert("文件上传出错！");
                    } else {
                        that.outBound.devicePictures.push({
                            id: response.id,
                            name: response.name,
                            url: response.url
                        });
                    }
                });
                // 文件上传失败，显示上传出错。
                this.uploader.on('uploadError', function (file) {
                    alert("上传失败！");
                });
            },
            deleteFileMore: function (type, i) {
                if (window.confirm("确定要删除该附件吗?")) {
                    if (type == 'hetong') {
                        this.displace.attaches.splice(i, 1);
                    } else {
                        this.displace.devicePictures.splice(i, 1);
                    }

                }
            },
            deleteFileMoreDevicePhoto: function (i) {
                if (window.confirm("确定要删除该附件吗?")) {
                    this.outBound.devicePictures.splice(i, 1);
                }
            },
            deleteFileMoreDriverCertificate: function (i) {
                if (window.confirm("确定要删除该附件吗?")) {
                    this.outBound.certificates.splice(i, 1);
                }
            },
            getId:function (namekey,namevalue,idkey,list){
                for(var i=0;i<list.length;i++){
                    if(list[i][namekey] == namevalue){
                        return list[i][idkey]
                    }
                }
                return '';
            },
            showDatePickerYear: function (e) {
                var that = this;
                WdatePicker({
                    onpicked: function (dp) {
                        that.displace.factoryDate = dp.cal.getNewDateStr();
                        return true;
                    },
                    dateFmt: 'yyyy'
                });
                $(e.target).blur();
            },
            inputFocus: function (id) {
                $("#" + id).focus();
            },
            /*数字判断限制*/
            fmoney: function (s, n) {
                s = isNaN(s)||s=="" ? 0: s;
                n = n > 0 && n <= 20 ? n : 2;
                s = parseFloat((s + "").replace(/[^\d\.-]/g, "")).toFixed(n) + "";
                var l = s.split(".")[0].split("").reverse(), r = s.split(".")[1],
                    t = "";
                for (i = 0; i < l.length; i++) {
                    t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? "," : "");
                }
                return t.split("").reverse().join("") + "." + r;
            },

            strFormat: function (target, data) {
                //此结果为了展示数据
                var value = (target.value).trim();
                value = value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g, '');
                if (!value) {
                    value = 0
                }
                ;
                //此结果为data存入数据
                var dataList = data.split('.');

                if (dataList.length > 0) {
                    if (dataList.length == 1) {
                        this[dataList[0]] = value;
                    }
                    if (dataList.length == 2) {
                        this[dataList[0]][dataList[1]] = value;
                    }
                    if (dataList.length == 3) {
                        this[dataList[0]][dataList[1]][dataList[2]] = value;
                    }
                    if (dataList.length == 4) {
                        this[dataList[0]][dataList[1]][dataList[2]][dataList[3]] = value;
                    }
                    if (dataList.length == 5) {
                        this[dataList[0]][dataList[1]][dataList[2]][dataList[3]][dataList[4]] = value;
                    }
                }
                target.value = this.fmoney(value);
            },
            strFormatF: function (target, data) {
                var value = '';
                var dataList = data.split('.');

                if (dataList.length > 0) {
                    if (dataList.length == 1) {
                        value = this[dataList[0]]
                    }
                    if (dataList.length == 2) {
                        value = this[dataList[0]][dataList[1]]
                    }
                    if (dataList.length == 3) {
                        value = this[dataList[0]][dataList[1]][dataList[2]]
                    }
                    if (dataList.length == 4) {
                        value = this[dataList[0]][dataList[1]][dataList[2]][dataList[3]]
                    }
                    if (dataList.length == 5) {
                        value = this[dataList[0]][dataList[1]][dataList[2]][dataList[3]][dataList[4]]
                    }
                }
                if (!value || value == '0.00') {
                    console.log('获取焦点', value)
                    value = '';
                }
                target.value = value;
            },
            getBigManagerAndRegion:function (userId) { //根据区域经理自动带出大区经理与区域
                var that = this;
                $.wyui.postMethod('/deviceDisplace/getBigManagerAndRegion.json', {userId:userId}, function (r) {
                    that.displace.bigregionManagerName=r.name,
                        that.displace.bigregionManagerId=r.id,
                        that.displace.regionName=r.departName
                })
            },
        },
        mounted: function () {
            var that = this;
            /*查询设备*/
            $.wyui.postMethod('/deviceSample/getDeviceTypeList.json', {}, function (r) {
                console.log(r);
                that.itemsType = r.records;
            })

            /*查询设备状态,设备来源*/
            $.wyui.postMethod('/enum2/selectByModuleType.json',{"moduleType":"DEVICE_SOURCE"},function(r){
                that.deviceSources=r;
            })
            $.wyui.postMethod('/enum2/selectByModuleType.json',{"moduleType":"DEVICE_STATUS"},function(r){
                that.deviceStatuss=r;
            })

            /*查询公司*/
            $.wyui.postMethod('/company/getCompanyListByUserId.json', {"userId": that.userId}, function (r) {
                console.log(r);
                if (r.records == "null") {
                    alert("未找到相关公司");
                } else {
                    that.itemsCom = r;
                    if('山西沃源,内蒙辽鞍'.indexOf(getCurrentUser().companyName)>-1){
                        that.itemsCom.push(
                            /*{"id":"201804031651473CA771C95F5B8A0ACF","name":"山西沃源"},
                            {"id":"2018041104174574AC1D4939178B2D27","name":"内蒙辽鞍"},*/
                            {"id":"wanliu","name":"湾流"},
                            {"id":"201712161613432EAF27DBCCB7D0E6CA","name":"滚滚向前集团"},
                            {"id":"2017121617464DFEB683A82815924552","name":"辽宁灜湖"},
                            {"id":"20171216174747FEAED47B7D5A930A0E","name":"江苏滚滚向前"},
                            {"id":"2017121617474A689E011EEA1635A09D","name":"河北灜源"},
                            {"id":"2017121617484353B8D81EEAFB4598A6","name":"湖南清源"},
                            {"id":"2017121617484B3A8193DB9B6CB372AC","name":"甘肃&宁夏"},
                            {"id":"2017121617484BB9BEB4A635E7458410","name":"安徽灜湖"},
                            {"id":"2017121910424ED9AA4F786D5549D72F","name":"江苏灜沣"},
                            {"id":"2018042608364206B46EC406F62EC079","name":"黑龙江灜源"},
                            {"id":"20180426083647FCBC7D08C7B14E496E","name":"吉林清源"},
                            {"id":"2019011814474FCDB1FC400060A3BEBF","name":"江苏沣澄"},
                            {"id":"","name":"其他"}
                        )
                    }
                }

            })
            that.displace.fundPossessionCost = 0;
            if (that.pageType != "look") {
                //初始化上传控件
                $(".fj").each(function () {

                    var demo = $(this);
                    var name = demo.attr("id");
                    var nameValue = name + "Name";
                    var uploader = WebUploader.create({
                        // 选完文件后，是否自动上传。
                        auto: true,
                        // swf文件路径
                        swf: "/statics/plugin/webuploader-0.1.5/Uploader.swf",
                        // 文件接收服务端。
                        server: server.fjIp + "/attach/uploadFile.json",
                        // 选择文件的按钮。可选。
                        // 内部根据当前运行是创建，可能是input元素，也可能是flash.
                        pick: '#' + demo.attr("id"),
                        duplicate: true
                    });

                    // 文件上传过程中创建进度条实时显示。
                    uploader.on('uploadProgress', function (file, percentage) {
                        console.log(percentage)
                        var $li = $('#' + file.id),
                            $percent = $li.find('.progress span');
                        // 避免重复创建
                        if (!$percent.length) {
                            $percent = $('<p class="progress"><span></span></p>')
                                .appendTo($li)
                                .find('span');
                        }
                        $percent.css('width', percentage * 100 + '%');
                    });
                    uploader.on("uploadStart", function () {
                        $("#progress").show();
                    });
                    uploader.on("uploadComplete", function () {
                        $("#progress").hide();
                    });
                    // 文件上传成功，给item添加成功class, 用样式标记上传成功。
                    uploader.on('uploadSuccess', function (file, response) {
                        console.log(demo);
                        var nameValue = name + "Name";
                        var urlValue = name + "Url";
                        if (name == 'cmodelCarPhoto' || name == 'cdriverCertificate' || name == 'cdevicePhoto') {
                            console.log(response)
                            app.transportChange[nameValue] = response.name;
                            app.transportChange[urlValue] = response.url;
                            console.log(app.transportChange)
                        } else if (name == 'devicePictures') {
                            app.displace.devicePictures.push({
                                id: response.id,
                                name: response.name,
                                url: response.url
                            });
                        } else {
                            app.displace[nameValue] = response.name;
                            app.displace[urlValue] = response.url;
                            console.log(app.displace)
                            $("#" + name).hide();
                        }

                    });
                    // 文件上传失败，显示上传出错。
                    uploader.on('uploadError', function (file) {
                        alert("上传失败！");
                    });

                });
                that.uploadMore();//初始化添加附件控件
                that.uploadOutMore();//初始化添加附件控件
                that.uploadOutMore2();//初始化添加附件控件
            }

        }
    })
</script>
<script>
    $("#regionManagerName").autoComplete({
        url: server.ip + urlConfig.contract.getRegionManagerByUserId,
            render: function (users, panel) {
            for (var i = 0; i < users.length; i++) {
                if (users[i].roleName == '区域经理' && users[i].companyName == app.displace.companyName&&users[i].jobState!=1) {

                    $("<li></li>").data("autoComplete",
                        users[i]).html("<a>" + users[i].name + "&nbsp;&nbsp;&nbsp;" +
                        "(" + "&nbsp;" + users[i].companyName + "-" + users[i].departName + "-" + users[i].roleName + "&nbsp;" + ") " + "</a>")
                        .appendTo(panel);
                }

            }
        },
        selected: function (user) {
            app.displace.regionManagerId = user.id;
            app.displace.regionManagerName = user.name;
            app.getBigManagerAndRegion(user.id);
            return false;
        },
        extraParams: {createUserId: getCurrentUser().id},
        height: 210,
        width: 420
    })
    ;
</script>
</html>